Extension of u5CMS to 5 languages


u5CMS (github → u5cms) is based on PHP8.1 and MariaDB and it currently supports 3 languages. The language mapping is not normalized, in the tables there is a column for each language. It is mandatory to stick to this. In general, the extension to 5 languages has to be done absolutely conservatively and no code refactoring should take place.

Thus, the first step is to extend all affected tables by two languages. At this opportunity the existing languages are to be renamed immediately in the tables to generics, because the current three languages work with the suffixes _d and _e and _f, these suffixes are to become generically to _1 and _2 and _3 ergo to supplement with _4 and _5.

When this is done in the tables, a search-and-replace must be done over all existing code, e.g. each string location in the code content_d becomes content_1.

Since in u5CMS installations executable code can come from the database, this renaming (SQL's Replace) must also be stored in the runonce.php file, namely in the resources table in the columns content_... and in the table formdata in the column datacsv.

Overview of the affected tables and columns respectively string locations:

Table resources, columns content..., title..., desc..., key..., search... (... = each _d, _e, _f respectively _1, _2, _3 after pre-treatment shown in the introductory section.

Idem table resources_log.

Table languages (some columns affected, is self-explanatory)
Idem tables loginglobals and titlefixum.

It is now a matter of finding each code place which is to be extended to 5 languages; one finds these places most simply with the search for "_3".

The following files have a high complexity regarding languages and must be studied very carefully:

u5admin/editor.php
and
u5admin/uploada.php

It is recommended to start the extension to 5 languages after the renaming in code and tables and extensions of the tables with editor.php executed above.

Last but not least, do not forget to regenerate and publish the u5standard.sql and u5converence.sql files.

Download

Content Management System u5CMS

Service

English⇄German Translation Service

Flowers

blumen-bern-maarsen.ch